//
//  GraphTester.h
//  AdvPropTestsCpp
//
//  Created by Brian Bogard on 2/25/12.
//  Copyright 2012 ASU. All rights reserved.
//

#ifndef AdvPropTestsCpp_GraphTester_h
#define AdvPropTestsCpp_GraphTester_h

#include <boost/shared_ptr.hpp>
#include "Graph.h"

class GraphTester
{
public:
    typedef boost::tuple< int, double > nodeValTuple;
    
    enum SELECT_ALG
    {
        DEGREE_CENTRALITY,
        CLOSENESS_CENTRALITY
    };
    
    GraphTester( boost::shared_ptr< Graph > _graphObj, float _activeEdgeProb, int _initRedSelect, GraphTester::SELECT_ALG _redSelectArg, int _numberOfGraphs, int _maxPropagationDist );
    int runTests();
    
private:
    boost::unordered_map< int, double > makeFirstSelection( boost::shared_ptr< Graph > _graphInstance, GraphTester::SELECT_ALG _selectionAlg );
    void setupFirstSelections( vector< boost::shared_ptr< Graph > > _graphInstances,
                               vector< boost::tuple< int, double > > _nodeList, 
                               int _numSelected, 
                               Node::COLOR _nodeColor );
    int makeSecondSelections( vector< boost::shared_ptr< Graph > > _graphInstances, vector< nodeValTuple > _nodeList, Node::COLOR _nodeColor );
    boost::unordered_map< int, double > makeSecondSelection( boost::shared_ptr< Graph > _graphInstance, Node::COLOR _nodeColor );
    
    //Shahrzad changed < to >.
    struct compareNodeVals 
    { 
        bool operator()( const nodeValTuple& a, const nodeValTuple& b) const 
        { 
            return boost::get<1>(a) > boost::get<1>(b);
        } 
    }; 
    
    
    boost::shared_ptr< Graph > m_baseGraph;
    int m_graphInstances;
    int m_initialRedSelection;
    float m_activeEdgeProb;
    GraphTester::SELECT_ALG m_redSelectionAlg;
    int m_maxPropagationDist;
    
    
};

#endif
